/*
 * Copyright (C) Cátedra SAES-UMU 2011 <pedromateo@um.es>
 *
 * Android HCI Extractor is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Android HCI Extractor is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.mmi.android.instrumentation.filters;

import org.mmi.android.instrumentation.BaseFilter;
import org.mmi.facades.BaseMmiFacade;

import android.view.View;

/**
 * This filters is not used for filtering.
 * It only uses the onInteractionStart and -End methods
 * to call the appStart and *End methods.
 * In the future maybe some Android events could be used
 * to indicate when te application starts and ends.
 * 
 * @author pedro mateo (pedromateo@um.es)
 *
 */
public class AppTimingFilter extends BaseFilter {
	
	private static final String TAG = "AppTimingFilter";

	/**
	 * Constructor
	 * @param f the model facade
	 */
	public AppTimingFilter(BaseMmiFacade f) {
		super(f);
	}
	
	///
	/// InteractionListener interface implementation
	///
	
	@Override
	public void onInteractionStart() {
		///
		/// the first thing we have to do is to notify that
		/// the application has started
		mmim_.interactionStarts(0);
	}

	@Override
	public void onInteractionEnd() {
		///
		/// at the end of the interaction we notify that
		/// the application is finished
		mmim_.interactionEnds(0);
	}
	
	///
	/// BaseFilter abstract methods implementation
	///
	

	@Override
	public void install(View v) {
		//this filter is not installed on views
	}

}
